package com.moyou.weichat.dapter;

import android.content.Context;
import android.view.View;

import com.bigkoo.convenientbanner.holder.Holder;
import com.moyou.weichat.view.MenuView;

/**
 * Created by Administrator on 2016/10/28 0028.
 */
public class ChatHolderView implements Holder<String> {

    private int chatType;

    private MenuView menuView;

    private MenuCall menuCall;

    public void setMenuCall(MenuCall menuCall) {
        this.menuCall = menuCall;
    }

    public ChatHolderView(int chatType) {
        this.chatType = chatType;
    }

    @Override

    public View createView(Context context) {
        menuView = new MenuView(context, chatType);
        return menuView;
    }

    @Override
    public void UpdateUI(Context context, int position, String data) {
        if (position == 0) {
            menuView.initView();
        } else {
            menuView.initTwoView();
        }
        menuView.setMenuCall(new MenuView.MenuCall() {
            @Override
            public void imageBtn() {
                menuCall.imageBtn();
            }

            @Override
            public void cameraBtn() {
                menuCall.cameraBtn();
            }

            @Override
            public void videoBtn() {
                menuCall.videoBtn();
            }

            @Override
            public void locationBtn() {
                menuCall.locationBtn();
            }

            @Override
            public void radBtn() {
                menuCall.radBtn();
            }

            @Override
            public void friendBtn() {
                menuCall.friendBtn();
            }

            @Override
            public void voiceCommunicate() {
                menuCall.voiceCommunicate();
            }

            @Override
            public void videoCommunicate() {
                menuCall.videoCommunicate();
            }

            @Override
            public void collectBtn() {
                menuCall.collectBtn();
            }

            @Override
            public void cardBtn() {
                menuCall.cardBtn();
            }
        });
    }

    public interface MenuCall {

        void imageBtn();

        void cameraBtn();

        void videoBtn();

        void locationBtn();

        void radBtn();

        void friendBtn();

        void voiceCommunicate();

        void videoCommunicate();

        void collectBtn();

        void cardBtn();


    }

}
